<!DOCTYPE html>
<html ng-app>
	<head>
		<meta charset="UTF-8">
		<title>updateClock3</title>
		<script src="https://cdn.bootcss.com/angular.js/1.2.23/angular.min.js"></script>
	</head>
	<body>
		<div id="" ng-controller="MyController">
			<h1>Hello {{clock.now}}</h1>
		</div>
		<script type="text/javascript">
			function MyController($scope){
				$scope.clock = {
					now: new Date()
				};
				var updateClock = function(){
					$scope.clock.now = new Date();
				};
				setInterval(function(){
					$scope.$apply(updateClock)
				},1000);
				updateClock();
			}
		</script>
	</body>
</html>
